package com.example.communist_app_api.service.impl;

import com.example.communist_app_api.db.dao.ArticleTypeDao;
import com.example.communist_app_api.db.pojoDto.Article;
import com.example.communist_app_api.db.pojoDto.ArticleType;
import com.example.communist_app_api.service.ArticleTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class ArticleTypeServiceImpl implements ArticleTypeService {

    @Autowired
    private ArticleTypeDao articleTypeDao;
    @Override
    public List<Article> getCategorizeArticles(Integer article_type_id) {
        return articleTypeDao.getCategorizeArticles(article_type_id);
    }


    @Override
    public int insertArticleType(ArticleType articleType) {
        int intNum = articleTypeDao.insertArticleType(articleType);
        return intNum;
    }
}
